import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useCounterStore = defineStore('counter', () => {
  const active = ref(0)
  const setactive = (val) => {
    active.value = val
  }

  return { active, setactive }
}, {
  // 5.实现pinia持久化缓存，刷新页面状态保留并回显
  persist: true,
})